]> arthur.barton.de Git - bup.git/commitdiff
wvtest.py: set wvtest to wvtest module if __main__
authorRob Browning <rlb@defaultvalue.org>
Tue, 29 Dec 2015 02:00:05 +0000 (20:00 -0600)
committerRob Browning <rlb@defaultvalue.org>
Tue, 29 Dec 2015 19:03:23 +0000 (13:03 -0600)
Without this, references to wvtest.* may fail, which can be demonstrated
(for example) by adding a "raise AttributeError('foo')' to
_add_posix1e_acl just before the "if posix1e.has_extended(path)" test.
Then "./wvtest.py lib/bup/t/tgit.py" will fail in the end with:

  NameError: global name 'wvtest' is not defined

As a result, wvtest.py never prints a "! ... FAILED" message for the
test, and so "wvtest report" never realizes there was a problem, and
then "make check" exits with zero status.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
wvtest.py

index 1c2981e9be31975fe58aa2bd7d85fa2a581ea0b6..ef03381bd0328bd8ae23476152b9bcfaf1e01b0f 100755 (executable)
--- a/wvtest.py
+++ b/wvtest.py
@@ -226,4 +226,5 @@ if __name__ == '__main__':
     import wvtest as _wvtestmod
     sys.modules['wvtest'] = _wvtestmod
     sys.modules['wvtest.wvtest'] = _wvtestmod
+    wvtest = _wvtestmod
     wvtest_main(sys.argv[1:])