Mercurial > python-hglib
annotate tests/__init__.py @ 70:bdc1650f216c
tests: set HGRCPATH so local hgrc's aren't loaded
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 09 Sep 2011 23:05:57 +0300 |
parents | 730c42743ba3 |
children | 20ffb6486412 |
rev | line source |
---|---|
7
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
1 import os, tempfile, sys, shutil |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
2 |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
3 def setUp(): |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
4 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
5 os.environ['TZ'] = 'GMT' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
6 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>" |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
7 os.environ['CDPATH'] = '' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
8 os.environ['COLUMNS'] = '80' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
9 os.environ['GREP_OPTIONS'] = '' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
10 os.environ['http_proxy'] = '' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
11 |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
12 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
13 os.environ["HGMERGE"] = "internal:merge" |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
14 os.environ["HGUSER"] = "test" |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
15 os.environ["HGENCODING"] = "ascii" |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
16 os.environ["HGENCODINGMODE"] = "strict" |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
17 tmpdir = tempfile.mkdtemp('', 'python-hglib.') |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
18 os.environ["HGTMP"] = os.path.realpath(tmpdir) |
70
bdc1650f216c
tests: set HGRCPATH so local hgrc's aren't loaded
Idan Kamara <idankk86@gmail.com>
parents:
67
diff
changeset
|
19 os.environ["HGRCPATH"] = "" |
7
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
20 |
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
21 def tearDown(self): |
67
730c42743ba3
tests: cleanup on test finish so Windows doesn't complain about used files
Idan Kamara <idankk86@gmail.com>
parents:
7
diff
changeset
|
22 os.chdir('..') |
7
eac8be119d81
tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
23 shutil.rmtree(os.environ["HGTMP"]) |