From 045e69281e6858041f43fe4dbbaa496ddcd34e31 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 26 Jan 2015 22:01:18 -0500 Subject: Give a reasonable warning for a previous assert. Closes #353. --- coverage/control.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 197a7c1..319f56d 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -722,12 +722,9 @@ class Coverage(object): ): self._warn("Module %s has no Python source." % pkg) else: - raise AssertionError( - "Unexpected third case: name = %s, " - "object = %r, " - "__file__ = %s" % ( - pkg, sys.modules[pkg], sys.modules[pkg].__file__ - ) + self._warn( + "Module %s was previously imported, " + "but not measured." % pkg ) # Find out if we got any data. -- cgit v1.2.1