From 4e1df3191aee1a902c873901b35d82363e13b08c Mon Sep 17 00:00:00 2001 From: Tin Tvrtkovic Date: Sat, 16 Oct 2021 01:26:56 +0200 Subject: [PATCH] Remove obsolete test, add make test --- Makefile | 5 +++- .../async_fixtures/test_coroutine_fixtures.py | 29 ------------------- 2 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 tests/async_fixtures/test_coroutine_fixtures.py diff --git a/Makefile b/Makefile index 425015de..8cf88841 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean clean-build clean-pyc clean-test lint +.PHONY: clean clean-build clean-pyc clean-test lint test clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts @@ -23,3 +23,6 @@ clean-test: ## remove test and coverage artifacts lint: ## check style with flake8 flake8 pytest_asyncio tests black --check --verbose pytest_asyncio tests + +test: + pytest tests diff --git a/tests/async_fixtures/test_coroutine_fixtures.py b/tests/async_fixtures/test_coroutine_fixtures.py deleted file mode 100644 index 65dabab5..00000000 --- a/tests/async_fixtures/test_coroutine_fixtures.py +++ /dev/null @@ -1,29 +0,0 @@ -import asyncio -import unittest.mock - -import pytest - -START = object() -END = object() -RETVAL = object() - -pytestmark = pytest.mark.skip( - reason="@asyncio.coroutine fixtures are not supported yet" -) - - -@pytest.fixture -def mock(): - return unittest.mock.Mock(return_value=RETVAL) - - -@pytest.fixture -async def coroutine_fixture(mock): - await asyncio.sleep(0.1, result=mock(START)) - - -@pytest.mark.asyncio -async def test_coroutine_fixture(coroutine_fixture, mock): - assert mock.call_count == 1 - assert mock.call_args_list[-1] == unittest.mock.call(START) - assert coroutine_fixture is RETVAL