diff --git a/tests/fixtures.py b/tests/fixtures.py deleted file mode 100644 index 5e9b20c..0000000 --- a/tests/fixtures.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Copyright (c) 2015 Red Hat, Inc -All rights reserved. - -This software may be modified and distributed under the terms -of the BSD license. See the LICENSE file for details. -""" - -import io - -import pytest - - -from dockerfile_parse import DockerfileParser - - -@pytest.fixture( - params=[(use_fileobj, cache_content) - for use_fileobj in [True, False] - for cache_content in [True, False]]) -def dfparser(tmpdir, request): - """ - - :param tmpdir: already existing fixture defined in pytest - :param request: parameter, cache_content arg to DockerfileParser - :return: DockerfileParser instance - """ - - use_fileobj, cache_content = request.param - if use_fileobj: - fileobj = io.BytesIO() - return DockerfileParser(fileobj=fileobj, cache_content=cache_content) - else: - tmpdir_path = str(tmpdir.realpath()) - return DockerfileParser(path=tmpdir_path, cache_content=cache_content) - - -@pytest.fixture(params=['LABEL', 'ENV', 'ARG']) -def instruction(request): - """ - Parametrized fixture which enables to run a test once for each instruction in params - """ - return request.param diff --git a/tests/test_parser.py b/tests/test_parser.py index dd07afc..c5db795 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -20,12 +20,8 @@ from dockerfile_parse.parser import image_from from dockerfile_parse.constants import COMMENT_INSTRUCTION from dockerfile_parse.util import b2u, u2b, Context, ImageName -from tests.fixtures import dfparser, instruction NON_ASCII = "žluťoučký" -# flake8 does not understand fixtures: -dfparser = dfparser # pylint: disable=self-assigning-variable -instruction = instruction # pylint: disable=self-assigning-variable @pytest.mark.parametrize(('image_string', 'dictionary'), [