Commit 7681ff9f authored by Jason R. Coombs's avatar Jason R. Coombs

Delete packages from sys.modules

parent af199e99
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
import sys
import contextlib import contextlib
import pytest import pytest
from distutils.errors import DistutilsOptionError, DistutilsFileError from distutils.errors import DistutilsOptionError, DistutilsFileError
...@@ -300,6 +302,9 @@ class TestMetadata: ...@@ -300,6 +302,9 @@ class TestMetadata:
with get_dist(tmpdir) as dist: with get_dist(tmpdir) as dist:
assert dist.metadata.version == '2016.11.26' assert dist.metadata.version == '2016.11.26'
del sys.modules['fake_package']
del sys.modules['fake_package.subpackage']
subpack.join('othersub.py').write( subpack.join('othersub.py').write(
'import third_party_module\n' 'import third_party_module\n'
'VERSION = (2016, 11, 26)' 'VERSION = (2016, 11, 26)'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment