Skip to content

bpo-45500: Rewrite test_dbm #29002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2021
Merged

bpo-45500: Rewrite test_dbm #29002

merged 1 commit into from
Oct 19, 2021

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 17, 2021

  • Generate test classes at import time. It allows to filter them when
    run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
  • Create a database class in a new directory which will be removed after
    test. It guarantees that all created files and directories be removed
    and will not conflict with other dbm tests.
  • Restore dbm._defaultmod after tests. Previously it was set to the last
    dbm module (dbm.dumb) which affected other tests.
  • Enable the whichdb test for dbm.dumb.
  • Move test_keys to the correct test class. It does not test whichdb().
  • Remove some outdated code and comments.

https://bugs.python.org/issue45500

* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments.
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir skip news 🔨 test-with-buildbots Test PR w/ buildbots; report in status section needs backport to 3.10 only security fixes labels Oct 17, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit 8c41898 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot added awaiting core review and removed 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Oct 17, 2021
@ambv
Copy link
Contributor

ambv commented Oct 19, 2021

Gentoo failures unrelated and covered by BPO-45436.

s390x failures are flaky asyncio and a pickle segfault, both of which are obviously unrelated to test_dbm.

@ambv ambv merged commit 975b94b into python:main Oct 19, 2021
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka and @ambv, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 975b94b9de969777218e96a9950c1dab2dab65a0 3.10

@ambv ambv added needs backport to 3.10 only security fixes and removed needs backport to 3.10 only security fixes labels Oct 19, 2021
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @serhiy-storchaka and @ambv, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 975b94b9de969777218e96a9950c1dab2dab65a0 3.10

ambv pushed a commit to ambv/cpython that referenced this pull request Oct 19, 2021
* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments..
(cherry picked from commit 975b94b)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Oct 19, 2021
@bedevere-bot
Copy link

GH-29069 is a backport of this pull request to the 3.10 branch.

ambv added a commit that referenced this pull request Oct 19, 2021
* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments..
(cherry picked from commit 975b94b)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka serhiy-storchaka deleted the test_dbm branch October 19, 2021 20:47
ambv pushed a commit to ambv/cpython that referenced this pull request Oct 19, 2021
* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments..
(cherry picked from commit 975b94b)

Co-authored-by: Serhiy Storchaka <[email protected]>
corona10 pushed a commit that referenced this pull request Oct 20, 2021
* Generate test classes at import time. It allows to filter them when
  run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after
  test. It guarantees that all created files and directories be removed
  and will not conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last
  dbm module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments..
(cherry picked from commit 975b94b)

Co-authored-by: Serhiy Storchaka <[email protected]>

Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants