From 59e61b053b095af4b6fb3e9fc491fd3052a37e3a Mon Sep 17 00:00:00 2001 From: Tommy Yu Date: Thu, 17 Oct 2024 15:12:29 +1300 Subject: [PATCH] Fix CI for Python 3.13 on Windows - Why the difference in behavior on the different platforms. --- README.rst | 1 + src/calmjs/parse/tests/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c29db78..4880b08 100644 --- a/README.rst +++ b/README.rst @@ -456,6 +456,7 @@ streams: >>> print(h4_program_min.read()) var b=function(a){return''+a+'';};var a=function(a){...}; //# sourceMappingURL=html4.min.js.map + ... For a simple concatenation of multiple sources into one file, along with inline source map (i.e. where the sourceMappingURL is a ``data:`` URL of diff --git a/src/calmjs/parse/tests/__init__.py b/src/calmjs/parse/tests/__init__.py index e951c7f..a0f416e 100644 --- a/src/calmjs/parse/tests/__init__.py +++ b/src/calmjs/parse/tests/__init__.py @@ -6,6 +6,7 @@ import doctest from textwrap import dedent from io import StringIO +from os.path import basename from os.path import dirname from pkg_resources import get_distribution @@ -38,7 +39,9 @@ def make_suite(): # pragma: no cover def open(p, flag='r'): result = StringIO(examples[p] if flag == 'r' else '') - result.name = p + # Need basename here because Python 3.13 under Windows broke + # _something_ and made the reporting inconsistent... + result.name = basename(p) return result parser = doctest.DocTestParser()