From 96c4cad98153bb96f0b40f405839a7b20c07bc4b Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 07:05:03 +0000 Subject: automatic import of python-junit-report --- .gitignore | 1 + python-junit-report.spec | 312 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 314 insertions(+) create mode 100644 python-junit-report.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..639f7cf 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/junit-report-0.2.7.tar.gz diff --git a/python-junit-report.spec b/python-junit-report.spec new file mode 100644 index 0000000..fcaa805 --- /dev/null +++ b/python-junit-report.spec @@ -0,0 +1,312 @@ +%global _empty_manifest_terminate_build 0 +Name: python-junit-report +Version: 0.2.7 +Release: 1 +Summary: Export your test suites and cases to JUnit report using decorators +License: MIT +URL: https://github.com/eliorerz/junit-report +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9d/35/270ff1cb960d079be49c2c82c3d2df2a48b47a917eb3f561688bb7782192/junit-report-0.2.7.tar.gz +BuildArch: noarch + +Requires: python3-pytest +Requires: python3-decorator +Requires: python3-junit-xml + +%description + +# Junit-Report + +This Python package adds more control to your tests by decorating your functions and pytest fixtures and exporting them as JUnit xml. + +**Table of contents** + +- [Junit-Report](#junit-report) + - [Installation](#installation) + - [Usage](#usage) + - [OS parameters used for configuration](#os-parameters-used-for-configuration) + + +## Installation + +```bash +pip install junit-report +``` + + +## Usage + +```python +import pytest + +from junit_report import JunitTestSuite, JunitTestCase, JunitFixtureTestCase + +class TestSomeThing: + + @pytest.fixture + @JunitFixtureTestCase() + def my_fixture(self): + # do stuff .. + + @JunitTestCase() + def nested_case(): + pass + + yield nested_case + + @JunitTestCase() + def my_first_test_case(self): + pass + + @JunitTestCase() + def my_second_test_case(self, name: str): + raise ValueError(f"Invalid name {name}") + + @JunitTestSuite() + def test_suite(self, my_fixture): + my_fixture() + self.my_first_test_case() + self.my_second_test_case("John") + +``` + + +### Output +```xml + + + + + + + + Traceback (most recent call last): ... ValueError: Invalid name John + + + +``` + +## OS parameters used for configuration + +| Variable | Description | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| JUNIT_REPORT_DIR | Reports directory where the reports will be extracted. If it does not exist - create it. | + + + + +%package -n python3-junit-report +Summary: Export your test suites and cases to JUnit report using decorators +Provides: python-junit-report +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-junit-report + +# Junit-Report + +This Python package adds more control to your tests by decorating your functions and pytest fixtures and exporting them as JUnit xml. + +**Table of contents** + +- [Junit-Report](#junit-report) + - [Installation](#installation) + - [Usage](#usage) + - [OS parameters used for configuration](#os-parameters-used-for-configuration) + + +## Installation + +```bash +pip install junit-report +``` + + +## Usage + +```python +import pytest + +from junit_report import JunitTestSuite, JunitTestCase, JunitFixtureTestCase + +class TestSomeThing: + + @pytest.fixture + @JunitFixtureTestCase() + def my_fixture(self): + # do stuff .. + + @JunitTestCase() + def nested_case(): + pass + + yield nested_case + + @JunitTestCase() + def my_first_test_case(self): + pass + + @JunitTestCase() + def my_second_test_case(self, name: str): + raise ValueError(f"Invalid name {name}") + + @JunitTestSuite() + def test_suite(self, my_fixture): + my_fixture() + self.my_first_test_case() + self.my_second_test_case("John") + +``` + + +### Output +```xml + + + + + + + + Traceback (most recent call last): ... ValueError: Invalid name John + + + +``` + +## OS parameters used for configuration + +| Variable | Description | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| JUNIT_REPORT_DIR | Reports directory where the reports will be extracted. If it does not exist - create it. | + + + + +%package help +Summary: Development documents and examples for junit-report +Provides: python3-junit-report-doc +%description help + +# Junit-Report + +This Python package adds more control to your tests by decorating your functions and pytest fixtures and exporting them as JUnit xml. + +**Table of contents** + +- [Junit-Report](#junit-report) + - [Installation](#installation) + - [Usage](#usage) + - [OS parameters used for configuration](#os-parameters-used-for-configuration) + + +## Installation + +```bash +pip install junit-report +``` + + +## Usage + +```python +import pytest + +from junit_report import JunitTestSuite, JunitTestCase, JunitFixtureTestCase + +class TestSomeThing: + + @pytest.fixture + @JunitFixtureTestCase() + def my_fixture(self): + # do stuff .. + + @JunitTestCase() + def nested_case(): + pass + + yield nested_case + + @JunitTestCase() + def my_first_test_case(self): + pass + + @JunitTestCase() + def my_second_test_case(self, name: str): + raise ValueError(f"Invalid name {name}") + + @JunitTestSuite() + def test_suite(self, my_fixture): + my_fixture() + self.my_first_test_case() + self.my_second_test_case("John") + +``` + + +### Output +```xml + + + + + + + + Traceback (most recent call last): ... ValueError: Invalid name John + + + +``` + +## OS parameters used for configuration + +| Variable | Description | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| JUNIT_REPORT_DIR | Reports directory where the reports will be extracted. If it does not exist - create it. | + + + + +%prep +%autosetup -n junit-report-0.2.7 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-junit-report -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot - 0.2.7-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..0e94db3 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +df60f264f9ebef80b74a5a2ca8e3c713 junit-report-0.2.7.tar.gz -- cgit v1.2.3