Skip to content
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

Add tests with RelStorage and sqlite. #39

Merged
merged 3 commits into from
Sep 1, 2020
Merged

Add tests with RelStorage and sqlite. #39

merged 3 commits into from
Sep 1, 2020

Conversation

jamadden
Copy link
Member

Fixes #30.

  • Refactor the tests to use a mixin class that defines the methods to create and cleanup storages.
  • Use unittest.skip decotarors instead of manually listing out the tests to run in test_suite(). This is simpler now that there are more test classes.
  • Add tests for history-free and history-preserving RelStorage storages. History preserving is tested locally, but will be skipped on CI because I haven't released RelStorage 3.3 yet.
  • Fix a test hygiene issue that caused subsequent tests to fail after test_skipped_types_are_left_untouched was run.

Fixes #30.

- Refactor the tests to use a mixin class that defines the methods to create and cleanup storages.
- Use unittest.skip decotarors instead of manually listing out the tests to run in test_suite(). This is simpler now that there are more test classes.
- Add tests for history-free and history-preserving RelStorage storages. History preserving is tested locally, but will be skipped on CI because I haven't released RelStorage 3.3 yet.
- Fix a test hygiene issue that caused subsequent tests to fail after test_skipped_types_are_left_untouched was run.
@jamadden jamadden requested a review from icemac August 31, 2020 17:59
Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/zodbupdate/tests.py Outdated Show resolved Hide resolved
src/zodbupdate/tests.py Outdated Show resolved Hide resolved
src/zodbupdate/tests.py Outdated Show resolved Hide resolved
src/zodbupdate/tests.py Outdated Show resolved Hide resolved
…rns.

Make FileStorage its own mixin, and put everything in the single temp directory, which is automatically torn down.
Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -140,8 +143,7 @@ class OtherFactory(persistent.Persistent):
sys.modules['module2'].interfaces = sys.modules['module2.interfaces']
sys.modules['module2.interfaces'].IOtherFactory = IOtherFactory

self.tmphnd, self.dbfile = tempfile.mkstemp()
self.tmpblob = tempfile.mkdtemp()
self.temp_dir = tempfile.mkdtemp('.zodbupdate')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@jamadden jamadden merged commit 8d33e32 into master Sep 1, 2020
@jamadden jamadden deleted the issue30 branch September 1, 2020 12:59
@jamadden
Copy link
Member Author

jamadden commented Sep 1, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test RelStorage in CI?
2 participants