From ae95c08feed91473461b9bad3365082d09a98de8 Mon Sep 17 00:00:00 2001 From: Justin Buist Date: Thu, 12 Dec 2024 11:49:14 -0500 Subject: [PATCH] Move plugin registration out of robot project --- pyfrc/mains/cli_add_tests.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/pyfrc/mains/cli_add_tests.py b/pyfrc/mains/cli_add_tests.py index 7b8a76a..0bb013d 100644 --- a/pyfrc/mains/cli_add_tests.py +++ b/pyfrc/mains/cli_add_tests.py @@ -10,30 +10,6 @@ from pyfrc.tests import * """ -conftest = """''' - This file registesr the PyFrcPlugin so it can be found during - distributed tests with pytest-xdist -''' - -import sys -import pathlib -from pyfrc.test_support.pytest_plugin import PyFrcPlugin - -# Add the location of robot.py to our path -parentdir = pathlib.Path(__file__).parent.parent -sys.path.append(str(parentdir)) -import robot - -def pytest_configure(config): - if config.pluginmanager.has_plugin("pyfrc_plugin"): - # Avoid double registration - return - robot_class = robot.MyRobot - robot_file = parentdir/'robot.py' - plugin = PyFrcPlugin(robot_class, robot_file) - config.pluginmanager.register(plugin, "pyfrc_plugin") -""" - class PyFrcAddTests: """ @@ -72,13 +48,4 @@ def run(self, main_file: pathlib.Path, project_path: pathlib.Path): fp.write(builtin_tests) print("- builtin tests created at", builtin_tests_file) - conftest_file = test_directory / "conftest.py" - if conftest_file.exists(): - print("- conftest.py already exists") - else: - with open(conftest_file, "w") as fp: - fp.write(conftest) - print("- conftest created at", conftest_file) - - print() print("Robot tests can be ran via 'robotpy test'")