From 1680068b83b08e86a936501c5304266719410f83 Mon Sep 17 00:00:00 2001 From: Sean Stewart Date: Thu, 20 Jun 2024 18:28:49 -0500 Subject: [PATCH] tests: shore up support for windows in tests --- tests/unit/marshal/test_routines.py | 3 ++- tests/unit/test_refs.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/marshal/test_routines.py b/tests/unit/marshal/test_routines.py index 29d48e1..ab2ef86 100644 --- a/tests/unit/marshal/test_routines.py +++ b/tests/unit/marshal/test_routines.py @@ -78,7 +78,8 @@ def test_uuid_marshaller(given_input, expected_output): @pytest.mark.suite( path=dict( - given_input=pathlib.Path("/path/to/file"), expected_output="/path/to/file" + given_input=pathlib.Path("/path/to/file"), + expected_output=str(pathlib.Path("/path/to/file")), ), ) def test_path_marshaller(given_input, expected_output): diff --git a/tests/unit/test_refs.py b/tests/unit/test_refs.py index bbcffac..38c8a33 100644 --- a/tests/unit/test_refs.py +++ b/tests/unit/test_refs.py @@ -1,3 +1,5 @@ +from unittest import mock + import pytest from typelib import refs @@ -27,7 +29,7 @@ class RefClass: ... no_module_provided=dict( given_ref_name="str", given_module_name=None, - expected_ref=refs.ForwardRef("str", module="__main__"), + expected_ref=refs.ForwardRef("str", module=mock.ANY), ), module_provided=dict( given_ref_name="str", @@ -47,7 +49,7 @@ class RefClass: ... module_from_caller=dict( given_ref_name="UnknownClass", given_module_name=None, - expected_ref=refs.ForwardRef("UnknownClass", module="__main__"), + expected_ref=refs.ForwardRef("UnknownClass", module=mock.ANY), ), ) def test_forwardref(given_ref_name, given_module_name, expected_ref):