Commit 4c62d634 authored by Jason R. Coombs's avatar Jason R. Coombs

Update test to create separate subpackages. Hoping that avoids issues with caching.

parent 7681ff9f
# -*- 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
...@@ -291,28 +290,27 @@ class TestMetadata: ...@@ -291,28 +290,27 @@ class TestMetadata:
with get_dist(tmpdir) as dist: with get_dist(tmpdir) as dist:
assert dist.metadata.version == '1' assert dist.metadata.version == '1'
subpack = tmpdir.join('fake_package').mkdir('subpackage') sub_a = tmpdir.join('fake_package').mkdir('subpkg_a')
subpack.join('__init__.py').write('') sub_a.join('__init__.py').write('')
subpack.join('submodule.py').write('VERSION = (2016, 11, 26)') sub_a.join('mod.py').write('VERSION = (2016, 11, 26)')
config.write( config.write(
'[metadata]\n' '[metadata]\n'
'version = attr: fake_package.subpackage.submodule.VERSION\n' 'version = attr: fake_package.subpkg_a.mod.VERSION\n'
) )
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'] sub_b = tmpdir.join('fake_package').mkdir('subpkg_b')
del sys.modules['fake_package.subpackage'] sub_b.join('__init__.py').write('')
sub_b.join('mod.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)'
) )
config.write( config.write(
'[metadata]\n' '[metadata]\n'
'version = attr: fake_package.subpackage.othersub.VERSION\n' 'version = attr: fake_package.subpkg_b.mod.VERSION\n'
) )
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'
......
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