From 6f284d3b5eeefe837e14d81f717fa04cfa2724a2 Mon Sep 17 00:00:00 2001 From: konstin Date: Wed, 17 Jun 2020 10:41:51 +0200 Subject: [PATCH] Fix tests on stable --- tests/test_dunder.rs | 6 +++++- tests/ui/invalid_pymethod_names.stderr | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_dunder.rs b/tests/test_dunder.rs index 67a66fb4961..47f22fc919a 100644 --- a/tests/test_dunder.rs +++ b/tests/test_dunder.rs @@ -612,7 +612,11 @@ async def main(): # but we see still errors on Github actions... if sys.platform == "win32" and sys.version_info >= (3, 8, 0): asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) -loop = asyncio.get_event_loop() +try: + loop = asyncio.get_event_loop() +except RuntimeError: # RuntimeError: There is no current event loop in thread 'Dummy-1'. + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) assert loop.run_until_complete(main()) is None loop.close() "# diff --git a/tests/ui/invalid_pymethod_names.stderr b/tests/ui/invalid_pymethod_names.stderr index fc1911ac191..17f3595b0b1 100644 --- a/tests/ui/invalid_pymethod_names.stderr +++ b/tests/ui/invalid_pymethod_names.stderr @@ -2,16 +2,16 @@ error: name not allowed with this attribute --> $DIR/invalid_pymethod_names.rs:10:5 | 10 | #[name = "num"] - | ^^^^^^^^^^^^^^^ + | ^ error: #[name] can not be specified multiple times --> $DIR/invalid_pymethod_names.rs:17:5 | 17 | #[name = "foo"] - | ^^^^^^^^^^^^^^^ + | ^ error: name not allowed with this attribute --> $DIR/invalid_pymethod_names.rs:24:5 | 24 | #[name = "makenew"] - | ^^^^^^^^^^^^^^^^^^^ + | ^