Commits
Akeem Wells authored 9356c3df488
665 665 | else: |
666 666 | try: |
667 667 | print("Copying: {} to {}".format(workdir + "tests/",test), workdir + "{}/".format(test if not test.endswith(".py") else test[:-3])) |
668 668 | shutil.copy2("{}{}.py".format(workdir + "tests/",test), workdir + "{}/".format(test if not test.endswith(".py") else test[:-3])) |
669 669 | except: |
670 670 | traceback.print_exc() |
671 671 | |
672 672 | # https://docs.pytest.org/en/stable/usage.html |
673 673 | |
674 674 | cmd = ["--verbose"] + ["-ra"] + ["--tb=short"] + cmd |
675 - | <<<<<<< HEAD |
676 - | |
677 - | if DRY_RUN: |
678 - | cmd = ["--collect-only"] + cmd |
679 - | |
680 - | if not os.path.isdir(workpath + '/xml/{}/'.format(test if not test.endswith(".py") else test[:-3])): |
681 - | os.makedirs(workpath + '/xml/{}/'.format(test if not test.endswith(".py") else test[:-3])) |
682 - | xmlfile = workpath + 'xml/{}/nose.xml'.format(test if not test.endswith(".py") else test[:-3]) |
683 - | |
684 - | cmd = ["--junitxml={}".format(xmlfile)] + ["-s"] + ["--disable-pytest-warnings"] + cmd |
685 - | #print("Running Command: pytest {}".format(cmd)) |
686 - | #print("Work Path: {}".format(workpath)) |
687 - | if len(os.listdir(workpath)) < 1: # If only the XML dir was created |
688 - | print("No Tests to Run") |
689 - | sys.exit() |
690 - | else: |
691 - | |
692 - | ======= |
693 - | |
694 675 | if DRY_RUN: |
695 676 | cmd = ["--collect-only"] + cmd |
696 677 | |
697 678 | if not os.path.isdir(workpath + '/xml/{}/'.format(test if not test.endswith(".py") else test[:-3])): |
698 679 | os.makedirs(workpath + '/xml/{}/'.format(test if not test.endswith(".py") else test[:-3])) |
699 680 | xmlfile = workpath + 'xml/{}/nose.xml'.format(test if not test.endswith(".py") else test[:-3]) |
700 681 | |
701 682 | cmd = ["--junitxml={}".format(xmlfile)] + ["-s"] + ["--disable-pytest-warnings"] + cmd |
702 683 | #print("Running Command: pytest {}".format(cmd)) |
703 684 | #print("Work Path: {}".format(workpath)) |
704 685 | if len(os.listdir(workpath)) < 1: # If only the XML dir was created |
705 686 | print("No Tests to Run") |
706 687 | sys.exit() |
707 688 | else: |
708 - | |
709 - | >>>>>>> master |
710 689 | myworkdir = os.getcwd() |
711 690 | os.chdir("{}".format(workdir + "{}/".format(test if not test.endswith(".py") else test[:-3]))) |
712 691 | print("Test Directory: {}".format(os.getcwd())) |
713 692 | print("Running Command: pytest {}".format(cmd)) |
714 693 | conf_name = os.path.join(os.getcwd(),"conftest.py") |
715 694 | if platform.system() == 'Darwin': |
716 695 | write_conftest_osx(conf_name) |
717 696 | else: |
718 697 | write_conftest_linux(conf_name) |
719 698 | pytest.main(cmd) |