summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/test_compat.py8
-rw-r--r--tests/unit/models/test_base.py6
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/integration/test_compat.py b/tests/integration/test_compat.py
index 381b675..a49cf39 100644
--- a/tests/integration/test_compat.py
+++ b/tests/integration/test_compat.py
@@ -3,11 +3,11 @@ from shutil import copyfile
import pytest
from requests_cache import CachedSession
-from tests.conftest import HTTPBIN_FORMATS, SAMPLE_CACHE_FILES
+from tests.conftest import HTTPBIN_FORMATS, SAMPLE_CACHE_FILES, httpbin
# TODO: Debug why this sometimes fails (mostly just on GitHub Actions)
-@pytest.mark.flaky(reruns=3)
+# @pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize('db_path', SAMPLE_CACHE_FILES)
def test_version_upgrade(db_path, tempfile_path):
"""Load SQLite cache files created with older versions of requests-cache.
@@ -21,5 +21,5 @@ def test_version_upgrade(db_path, tempfile_path):
session = CachedSession(tempfile_path)
for response_format in HTTPBIN_FORMATS:
- session.get(f'https://httpbin.org/{response_format}').from_cache
- assert session.get(f'https://httpbin.org/{response_format}').from_cache is True
+ session.get(httpbin(response_format)).from_cache
+ assert session.get(httpbin(response_format)).from_cache is True
diff --git a/tests/unit/models/test_base.py b/tests/unit/models/test_base.py
index 25a4a23..d91ddc2 100644
--- a/tests/unit/models/test_base.py
+++ b/tests/unit/models/test_base.py
@@ -24,3 +24,9 @@ def test_rich_mixin():
('int_attr', 1, None),
('list_attr', ['a', 'b'], []),
]
+
+
+def test_repr():
+ """Test that regular __repr__ excludes default values"""
+ assert repr(DemoModel() == 'DemoModel()')
+ assert repr(DemoModel(str_attr='str') == "DemoModel(str_attr='str')")