summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/eggsrc/setup.py11
-rw-r--r--tests/test_config.py4
-rw-r--r--tests/test_filereporter.py27
-rw-r--r--tests/zipsrc/zip1/__init__.py (renamed from tests/eggsrc/egg1/__init__.py)0
-rw-r--r--tests/zipsrc/zip1/zip1.py (renamed from tests/eggsrc/egg1/egg1.py)4
5 files changed, 19 insertions, 27 deletions
diff --git a/tests/eggsrc/setup.py b/tests/eggsrc/setup.py
deleted file mode 100644
index 26a0b650..00000000
--- a/tests/eggsrc/setup.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
-# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
-
-from setuptools import setup
-
-setup(
- name="covtestegg1",
- packages=['egg1'],
- zip_safe=True,
- install_requires=[],
- )
diff --git a/tests/test_config.py b/tests/test_config.py
index b1611c1b..3330290f 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -533,8 +533,8 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest):
[testenv]
commands =
- # Create tests/zipmods.zip, install the egg1 egg
- python igor.py zip_mods install_egg
+ # Create tests/zipmods.zip
+ python igor.py zip_mods
"""
def assert_config_settings_are_correct(self, cov):
diff --git a/tests/test_filereporter.py b/tests/test_filereporter.py
index d928eea4..8ce2201d 100644
--- a/tests/test_filereporter.py
+++ b/tests/test_filereporter.py
@@ -4,6 +4,7 @@
"""Tests for FileReporters"""
import os
+import sys
from coverage.plugin import FileReporter
from coverage.python import PythonFileReporter
@@ -87,18 +88,20 @@ class FileReporterTest(UsingModulesMixin, CoverageTest):
assert acu < bcu and acu <= bcu and acu != bcu
assert bcu > acu and bcu >= acu and bcu != acu
- def test_egg(self):
- # Test that we can get files out of eggs, and read their source files.
- # The egg1 module is installed by an action in igor.py.
- import egg1
- import egg1.egg1
+ def test_zipfile(self):
+ sys.path.append("tests/zipmods.zip")
- # Verify that we really imported from an egg. If we did, then the
+ # Test that we can get files out of zipfiles, and read their source files.
+ # The zip1 module is installed by an action in igor.py.
+ import zip1
+ import zip1.zip1
+
+ # Verify that we really imported from an zipfile. If we did, then the
# __file__ won't be an actual file, because one of the "directories"
- # in the path is actually the .egg zip file.
- self.assert_doesnt_exist(egg1.__file__)
+ # in the path is actually the zip file.
+ self.assert_doesnt_exist(zip1.__file__)
- ecu = PythonFileReporter(egg1)
- eecu = PythonFileReporter(egg1.egg1)
- assert ecu.source() == u""
- assert u"# My egg file!" in eecu.source().splitlines()
+ z1 = PythonFileReporter(zip1)
+ z1z1 = PythonFileReporter(zip1.zip1)
+ assert z1.source() == u""
+ assert u"# My zip file!" in z1z1.source().splitlines()
diff --git a/tests/eggsrc/egg1/__init__.py b/tests/zipsrc/zip1/__init__.py
index e69de29b..e69de29b 100644
--- a/tests/eggsrc/egg1/__init__.py
+++ b/tests/zipsrc/zip1/__init__.py
diff --git a/tests/eggsrc/egg1/egg1.py b/tests/zipsrc/zip1/zip1.py
index 939386e3..79e0ebc3 100644
--- a/tests/eggsrc/egg1/egg1.py
+++ b/tests/zipsrc/zip1/zip1.py
@@ -1,7 +1,7 @@
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
-# My egg file!
+# My zip file!
-walrus = "Eggman"
+lighter = "Zippo"
says = "coo-coo cachoo"