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

Python<3.9 does not support OR operator for dictionaries, skip test. #454

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tests/test_std_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import unittest

from kbmod import StandardizerConfig
Expand Down Expand Up @@ -27,7 +29,6 @@ def test_config(self):

conf["a"] = 10
self.assertEqual(conf["a"], 10)
self.assertEqual(conf2 | conf, expected)
self.assertEqual(list(iter(conf)), ["a", "b", "c"])

# Test .update method
Expand All @@ -45,3 +46,14 @@ def test_config(self):

with self.assertRaises(TypeError):
conf2.update([1, 2, 3])

@unittest.skipIf(sys.version_info < (3, 9), "py<3.9 does not support or for dicts.")
def test_or(self):
expected = {"a": 1, "b": 2, "c": 3}
conf = StandardizerConfig(expected)
conf2 = StandardizerConfig(a=1, b=2, c=3)
self.assertEqual(conf2 | conf, expected)


if __name__ == "__main__":
unittest.main()
Loading