From b604061106853fdb9258e0ccce281bc97e107cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Sat, 1 Feb 2020 14:40:54 +0100 Subject: [PATCH 1/3] Add Python 3.8 to CI --- .github/workflows/test.yml | 2 +- .travis.yml | 2 -- tox.ini | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54310245488..2b56a778170 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.5, 3.6, 3.7] + python-version: [3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v1 diff --git a/.travis.yml b/.travis.yml index 99df14986a6..93f98dea17c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,6 @@ matrix: - name: PyPy3.5 7.0 # Tested via anaconda PyPy (since travis's PyPy version is too old) python: "3.7" env: FEATURES="pypy" PATH="$PATH:/opt/anaconda/envs/pypy3/bin" - allow_failures: - - python: "3.8-dev" env: global: diff --git a/tox.ini b/tox.ini index 7c7e1ceddb8..6bbebd29ec0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py35, py36, py37, + py38, minversion = 3.4.0 skip_missing_interpreters = true From eb49983bea75110502e5c373f8d36dd7c9d56a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Sat, 1 Feb 2020 17:00:12 +0100 Subject: [PATCH 2/3] Give test subclasses unique names to avoid race conditions --- tests/test_datetime.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test_datetime.rs b/tests/test_datetime.rs index 6453dc68441..df7484cf425 100644 --- a/tests/test_datetime.rs +++ b/tests/test_datetime.rs @@ -15,9 +15,11 @@ fn _get_subclasses<'p>( let locals = [(py_type, datetime.get(py_type)?)].into_py_dict(*py); - let make_subclass_py = format!("class Subklass({}):\n pass", py_type); + let subclass_name = format!("Subklass{}", py_type); + let make_subclass_py = format!("class {}({}):\n pass", subclass_name, py_type); - let make_sub_subclass_py = "class SubSubklass(Subklass):\n pass"; + let subsubclass_name = format!("SubSubklass{}", py_type); + let make_sub_subclass_py = format!("class {}({}):\n pass", subsubclass_name, subclass_name); py.run(&make_subclass_py, None, Some(&locals))?; py.run(&make_sub_subclass_py, None, Some(&locals))?; @@ -26,10 +28,14 @@ fn _get_subclasses<'p>( let obj = py.eval(&format!("{}({})", py_type, args), None, Some(&locals))?; // Construct an instance of the subclass - let sub_obj = py.eval(&format!("Subklass({})", args), None, Some(&locals))?; + let sub_obj = py.eval(&format!("{}({})", subclass_name, args), None, Some(&locals))?; // Construct an instance of the sub-subclass - let sub_sub_obj = py.eval(&format!("SubSubklass({})", args), None, Some(&locals))?; + let sub_sub_obj = py.eval( + &format!("{}({})", subsubclass_name, args), + None, + Some(&locals), + )?; Ok((obj, sub_obj, sub_sub_obj)) } From 3ca1707eb547aeff27a8b6dd842bb84fa1225a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Sat, 1 Feb 2020 19:12:44 +0100 Subject: [PATCH 3/3] Try to get the error message --- .github/workflows/test.yml | 1 + tests/test_datetime.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b56a778170..a16433ad75d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,3 +33,4 @@ jobs: run: ci/actions/test env: RUST_BACKTRACE: 1 + PYTHONUNBUFFERED: 1 diff --git a/tests/test_datetime.rs b/tests/test_datetime.rs index df7484cf425..644140bd2b8 100644 --- a/tests/test_datetime.rs +++ b/tests/test_datetime.rs @@ -22,13 +22,16 @@ fn _get_subclasses<'p>( let make_sub_subclass_py = format!("class {}({}):\n pass", subsubclass_name, subclass_name); py.run(&make_subclass_py, None, Some(&locals))?; + py.run("print('subclass ok')", None, None)?; py.run(&make_sub_subclass_py, None, Some(&locals))?; + py.run("print('subsubclass ok')", None, None)?; // Construct an instance of the base class let obj = py.eval(&format!("{}({})", py_type, args), None, Some(&locals))?; // Construct an instance of the subclass let sub_obj = py.eval(&format!("{}({})", subclass_name, args), None, Some(&locals))?; + py.run("print('instance subclass ok')", None, None)?; // Construct an instance of the sub-subclass let sub_sub_obj = py.eval( @@ -36,6 +39,7 @@ fn _get_subclasses<'p>( None, Some(&locals), )?; + py.run("print('instance subsubclass ok')", None, None)?; Ok((obj, sub_obj, sub_sub_obj)) }