Skip to content

Commit

Permalink
Move test folder to project root
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianonicolai committed Nov 13, 2023
1 parent 99b0205 commit 358bd1c
Show file tree
Hide file tree
Showing 140 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ site
.DS_Store
src/molecule/_version.py
.vscode
src/molecule/test/resources/.extensions/
test/resources/.extensions/
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
# Temporary excludes so we can gradually normalize the formatting
exclude: >
(?x)^(
src/molecule/test/resources/templates/.*|
test/resources/templates/.*|
)$
additional_dependencies:
- prettier
Expand Down Expand Up @@ -57,7 +57,7 @@ repos:
- id: mypy
# empty args needed in order to match mypy cli behavior
args: []
entry: mypy src/
entry: mypy src/ test/
pass_filenames: false
additional_dependencies:
- ansible-compat>=4.1.8
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ norecursedirs = [
"build",
"dist",
"doc",
"src/molecule/test/resources",
"src/molecule/test/scenarios",
"test/resources",
"test/scenarios",
]
addopts = "--doctest-modules --durations 10 --color=yes"
doctest_optionflags = ["ALLOW_UNICODE", "ELLIPSIS"]
junit_suite_name = "molecule_test_suite"
testpaths = "src/molecule/test/"
testpaths = "test/"
filterwarnings = [
# treat warnings as errors unless we add them below
"error",
Expand Down Expand Up @@ -216,7 +216,7 @@ parametrize-values-type = "tuple"
known-first-party = ["molecule"]

[tool.ruff.per-file-ignores]
"src/molecule/test/**.py" = ["S"]
"test/**.py" = ["S"]
"src/molecule/*/\\{\\{*/**.py" = ["S"]

[tool.setuptools.dynamic]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _instance(_base_class, config_instance: config.Config):

@pytest.fixture()
def _patched_base_setup(mocker):
return mocker.patch("molecule.test.a_unit.command.test_base.ExtendedBase._setup")
return mocker.patch("test.a_unit.command.test_base.ExtendedBase._setup")


@pytest.fixture()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/molecule/test/a_unit/conftest.py → test/a_unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
from collections.abc import Generator
from pathlib import Path
from subprocess import CompletedProcess
from test.conftest import (
molecule_directory,
molecule_ephemeral_directory,
molecule_file,
molecule_scenario_directory,
)
from typing import Any
from unittest.mock import Mock
from uuid import uuid4
Expand All @@ -32,12 +38,6 @@
from pytest_mock import MockerFixture

from molecule import config, util
from molecule.test.conftest import (
molecule_directory,
molecule_ephemeral_directory,
molecule_file,
molecule_scenario_directory,
)


def write_molecule_file(filename: str, data: Any) -> None:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# DEALINGS IN THE SOFTWARE.

import os
from test.conftest import is_subset

import pytest
from pytest_mock import MockerFixture

from molecule import config
from molecule.driver import delegated
from molecule.test.conftest import is_subset


@pytest.fixture()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_molecule_schema():
"-v",
"--schemafile",
"src/molecule/data/molecule.json",
"src/molecule/test/resources/schema_instance_files/valid/molecule.yml",
"test/resources/schema_instance_files/valid/molecule.yml",
]
assert run_command(cmd).returncode == 0

Expand All @@ -41,6 +41,6 @@ def test_molecule_schema():
"-v",
"--schemafile",
"src/molecule/data/driver.json",
"src/molecule/test/resources/schema_instance_files/invalid/molecule_delegated.yml",
"test/resources/schema_instance_files/invalid/molecule_delegated.yml",
]
assert run_command(cmd).returncode != 0
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import collections
import os
import re
from test.a_unit.conftest import os_split

import pytest
from pytest_mock import MockerFixture

from molecule import config, util
from molecule.provisioner import ansible, ansible_playbooks
from molecule.test.a_unit.conftest import os_split


@pytest.fixture()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
# DEALINGS IN THE SOFTWARE.

import os
from test.a_unit.conftest import os_split

import pytest

from molecule import config, util
from molecule.provisioner import ansible_playbooks
from molecule.test.a_unit.conftest import os_split


@pytest.fixture()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import os
import warnings
from pathlib import Path
from test.conftest import get_molecule_file, molecule_directory
from typing import Any

import pytest
Expand All @@ -32,7 +33,6 @@
from molecule.api import IncompatibleMoleculeRuntimeWarning, MoleculeRuntimeWarning
from molecule.console import console
from molecule.constants import MOLECULE_HEADER
from molecule.test.conftest import get_molecule_file, molecule_directory
from molecule.text import strip_ansi_escape


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import shutil
import subprocess
from subprocess import PIPE
from test.conftest import change_dir_to, molecule_directory

import pexpect
import pytest
Expand All @@ -33,7 +34,6 @@
import molecule
from molecule import logger, util
from molecule.app import app
from molecule.test.conftest import change_dir_to, molecule_directory
from molecule.text import strip_ansi_color
from molecule.util import run_command

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@

import os
import pathlib

import pytest
from pytest import FixtureRequest

from molecule.command import base
from molecule.test.b_functional.conftest import (
from test.b_functional.conftest import (
idempotence,
init_scenario,
list_with_format_plain,
run_test,
verify,
)

import pytest
from pytest import FixtureRequest

from molecule.command import base
from molecule.util import run_command


Expand Down Expand Up @@ -334,7 +334,7 @@ def test_sample_collection() -> None:
assert (
run_command(
["molecule", "test"],
cwd="src/molecule/test/resources/sample-collection",
cwd="test/resources/sample-collection",
).returncode
== 0
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ galaxy_info:
author: Molecule Developer
description: Role to test ansible_compat installation of role
namespace: molecule
role_name: delegated-test
role_name: delegated_test
license: GPL
min_ansible_version: "2.10"
File renamed without changes.
File renamed without changes.

0 comments on commit 358bd1c

Please sign in to comment.