Skip to content

Commit

Permalink
Merge pull request #20 from zopefoundation/remove-file-tests
Browse files Browse the repository at this point in the history
Remove 'try/except NameError' around uses of __file__

See #13 (comment)
  • Loading branch information
jamadden committed Feb 14, 2017
2 parents 010cb2b + 9f47e1b commit 0d7ec6e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
6 changes: 0 additions & 6 deletions ZConfig/tests/support.py
Expand Up @@ -24,12 +24,6 @@
from ZConfig._compat import NStringIO as StringIO
from ZConfig._compat import pathname2url

try:
__file__
except NameError: # pragma: no cover
import sys
__file__ = sys.argv[0]

d = os.path.abspath(os.path.join(os.path.dirname(__file__), "input"))
CONFIG_BASE = "file://%s/" % pathname2url(d)

Expand Down
7 changes: 1 addition & 6 deletions ZConfig/tests/test_datatypes.py
Expand Up @@ -23,12 +23,7 @@

import ZConfig.datatypes

try:
here = __file__
except NameError: # pragma: no cover
here = sys.argv[0]

here = os.path.abspath(here)
here = os.path.abspath(__file__)

try:
unicode
Expand Down
7 changes: 1 addition & 6 deletions ZConfig/tests/test_loader.py
Expand Up @@ -28,12 +28,7 @@
from ZConfig.tests.support import CONFIG_BASE, TestHelper


try:
myfile = __file__
except NameError: # pragma: no cover
myfile = sys.argv[0]

myfile = os.path.abspath(myfile)
myfile = os.path.abspath(__file__)
LIBRARY_DIR = os.path.join(os.path.dirname(myfile), "library")


Expand Down

0 comments on commit 0d7ec6e

Please sign in to comment.