diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-06-19 21:29:22 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-19 21:29:22 (GMT) |
| commit | 00f9edb98dd64e14daf5c44f303deca5cbc3cdeb (patch) | |
| tree | 2389e3e854d72d5882ae3d64084bb2a19caf8554 /Lib/test/test_dbm_gnu.py | |
| parent | 06fe77a84bd29d51506ab2ff703ae585a6121af2 (diff) | |
| download | cpython-00f9edb98dd64e14daf5c44f303deca5cbc3cdeb.zip cpython-00f9edb98dd64e14daf5c44f303deca5cbc3cdeb.tar.gz cpython-00f9edb98dd64e14daf5c44f303deca5cbc3cdeb.tar.bz2 | |
bpo-33901: Add _gdbm._GDBM_VERSION (GH-7794)
* Fix also PyInit__gdbm() to catch errors.
* test.pythoninfo: add gdbm.version
* test_dbm_gnu now logs GDBM_VERSION when run in verbose mode.
* pythoninfo: rename function to collect_gdbm()
Diffstat (limited to 'Lib/test/test_dbm_gnu.py')
| -rw-r--r-- | Lib/test/test_dbm_gnu.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py index 379601a..49f9170 100644 --- a/Lib/test/test_dbm_gnu.py +++ b/Lib/test/test_dbm_gnu.py @@ -8,6 +8,17 @@ from test.support import TESTFN, TESTFN_NONASCII, unlink filename = TESTFN class TestGdbm(unittest.TestCase): + @staticmethod + def setUpClass(): + if support.verbose: + try: + import _gdbm + version = _gdbm._GDBM_VERSION + except (ImportError, AttributeError): + pass + else: + print(f"gdbm version: {version}") + def setUp(self): self.g = None |
