Coverage for tests/test_boilerplate.py: 100.00%

9 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-14 17:01 +1100

1"""Add tests for boilerplate functions, to isolate relatively "trivial", awkward unit tests done to increase coverage.""" 

2 

3import refcount 

4 

5 

6# https://discuss.python.org/t/please-make-package-version-go-away/58501 

7# def test_has_version() -> None: 

8# """Check that the package has an `__version__` attribute.""" 

9# assert refcount.__version__ is not None 

10# assert refcount.__version__ != "" 

11 

12 

13def test_nativehandle() -> None: 

14 """test_nativehandle.""" 

15 import pytest 

16 

17 from refcount.base import NativeHandle 

18 

19 rc = NativeHandle() 

20 with pytest.raises(NotImplementedError): 

21 rc._is_valid_handle(None) 

22 with pytest.raises(NotImplementedError): 

23 rc._is_valid_handle(None)