for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from pincer.utils.conversion import remove_none
class TestSnowflake:
def test_remove_none(self):
If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example
class Foo: def some_method(self, x, y): return x + y;
could be written as
class Foo: @classmethod def some_method(cls, x, y): return x + y;
assert remove_none([None, 1]) == [1]
assert remove_none({None, 1}) == {1}
assert remove_none({'a': 1, 'b': None}) == {'a': 1}