From cd30d8e74b76f537724185852a049a2c95b8c775 Mon Sep 17 00:00:00 2001 From: AlexSchmidtNmTafe Date: Wed, 9 Sep 2026 12:13:02 +0800 Subject: [PATCH 1/5] Enable automated testing --- .github/workflows/python-app.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..cbb9a7d --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,46 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + pull-requests: write + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest --cov-report "xml:coverage.xml" --cov=. + - name: Create Coverage + if: ${{ github.event_name == 'pull_request' }} + uses: orgoro/coverage@v3 + with: + coverageFile: coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} From 48dc6b3513e97853672d1003d1e60d3996257420 Mon Sep 17 00:00:00 2001 From: AlexSchmidtNmTafe Date: Wed, 9 Sep 2026 12:15:30 +0800 Subject: [PATCH 2/5] Uncomment test --- __pycache__/functions.cpython-312.pyc | Bin 0 -> 758 bytes .../test_functions.cpython-312-pytest-9.1.1.pyc | Bin 0 -> 2274 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 __pycache__/functions.cpython-312.pyc create mode 100644 __pycache__/test_functions.cpython-312-pytest-9.1.1.pyc diff --git a/__pycache__/functions.cpython-312.pyc b/__pycache__/functions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea27f70c860dd427ea5572d8786fd10f8c3e759e GIT binary patch literal 758 zcma)3L2DC16rR~lB{mJBErOts>w+mUCL&VwAcBI#LiADw!ghDsu55PG_hw61a>&7h z-i3Jd*x*l5LFh$RPkQnu-J5vuy-ij} z%RBBK=x9#|203kGF8q=gM+X|r;P>^w!~;)<7$gX*6v-XI^8^#|skZv!?#r#CbH{6! zkMwb^^S;t4den0&#fXY(^SbS-p0XSo$)5w zuqz?dLl7K#V-Fm1Mfp$Qk~FPSO;vH=lp9iRJ@Lk4JKIn}uSkqMZ+^cw?>)bHGamm| zuU8N>@^o+GSB%gfoMcT(!RcoJenK{~v4?s%86{t~B#eBeSHOHm@>IXrEBd8g$uIZH ziB1MxrB_Wb_G-PFt=vbw`Veb{6CV1uCNtTzZC0X#wV0Sz%u4>ii`~c@YM8xig~6sn zVxw=a6DL@A+}Mai!*V?84yctTmkcG4GW1hLNixM_$Y_jXSdnNWG{XDodd8A1kL8gx zlE0ouXsnDB`Yh(&N!x%3=bH^SeQX!FPhZ+kEo?O|W|kW~gL7>^<(r7kPQ_2^{i11{ z)BQAKGVM{zr*rUkj{rkHXRCOL&j@AF|HTf!qMh`Lc5-HC7k@77s8I8QU9!ugf{PQT z#xvQ%rZT&j>CVQHnnlXS@8C3U!)`;z&?V@~Shg#$|J8rk|JwiiFRHrnvUBpE-~S=f z>bFn$=YGP!h?4>c4L_GwS2euTy)qvSmo-}XCIxe=a~!oaI?u`vZcH!eBA2$qc5fT#iy3r4bZ^nkR9eHM8#xSE5S(U#*q~4w;3)5t2 znp~eIABYr1=yvM`)}j20oD=Q&<|jAwub@IyUuv}$7Z;Xv8V-o%=#Xtl^-im^+@Kx( z(>tGkp;L!aNUz~+n||auRHxS)@P}|W-FVo}v<=JE?+m|$;<>@yTf$OLYS|wIU>pXt z84X!Ul-IV&703oIAVjaiMf)v!GIQ}jnSF2>#E%QR_a0pSp$l+=LF{%X`1_m3$}BvO z1r;Qhhulf9qcivjZ0`x}LmoPZyWJd4uz=^}lbJUUl;%VQ0oiO#)T8Ppz- zRt~GpV}(DDQ-xr;Jmijo9i72PN^^HhXdm+MIfR%w-dhpyoP;-@Lb;H3ft9i|NZtYk zn>EC#ZHj{frEU^ui?}hIz+AwU0 literal 0 HcmV?d00001 From 362cfa07a44595737a67f4450af9a46d23d55a9c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 9 Sep 2026 14:44:06 +0800 Subject: [PATCH 3/5] Fixed yml --- .github/workflows/python-app.yml | 2 +- .idea/.gitignore | 10 ++++++++++ .idea/PyTestingExample.iml | 11 +++++++++++ .idea/inspectionProfiles/Project_Default.xml | 12 ++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 7 +++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 8 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/PyTestingExample.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index cbb9a7d..b6979ac 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application +name: Test on: push: diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/PyTestingExample.iml b/.idea/PyTestingExample.iml new file mode 100644 index 0000000..3af93d0 --- /dev/null +++ b/.idea/PyTestingExample.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..710d32f --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..590a59e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8f106c9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 0320ff4a4739725687d5a832f180c05fe54d40cb Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 9 Sep 2026 14:47:22 +0800 Subject: [PATCH 4/5] fixed by breaking test --- test_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_functions.py b/test_functions.py index ffd7a65..8c10688 100644 --- a/test_functions.py +++ b/test_functions.py @@ -8,8 +8,8 @@ def test_add(): assert add("space", "ship") == "spaceship" -# def test_subtract(): -# assert subtract(3,2) == 1 +def test_subtract(): + assert subtract(3,2) == -1 # def test_convert_fahrenheit_to_celsius(): From 40261d77daec131824098bbba0f96f683fa221de Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 9 Sep 2026 14:59:19 +0800 Subject: [PATCH 5/5] Fixed subtraction code and test --- __pycache__/functions.cpython-314.pyc | Bin 0 -> 753 bytes .../test_functions.cpython-314-pytest-9.1.1.pyc | Bin 0 -> 3307 bytes functions.py | 2 +- test_functions.py | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 __pycache__/functions.cpython-314.pyc create mode 100644 __pycache__/test_functions.cpython-314-pytest-9.1.1.pyc diff --git a/__pycache__/functions.cpython-314.pyc b/__pycache__/functions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dee607eade108daebd49acb04f233450d7e39c7e GIT binary patch literal 753 zcmah`&r2IY6n?WCOKNJ1KWOn_5dwiw6@&;yq&-NXf~c&mf({MqW;AOzyJ2S5n%n*Z zz4g#*Z|3Abq9AyYrKk4fO-zp-d~dR=z2(7t^SycB%$xV#o983LfOcyCI{btCUvhF| z8R@-7l7IuRK!d{&nPVYZj*VzLg)&r!JS)G3J8>IVZww)UZ8n2@Ze{4QwJvn6l({L} zQzWib(%t1n{#gmBxbm7U-{qT8EIq*;(T)^f*;wD?o_{p!qc^LBQhpRF{!NIlZ@H`I z`9|lHP}&aKbM_J3JKo)%TSr={y@If5>QCEb-JgaJ87oY{aJtvJwrJLt$4sHa-~%aPBF zUV4JdOkoa50{kJy>D1U3e3`CglXFT^j%K@#oIT*yY5`iMTA)E($f% zsI_Xr%*tfz=cTLtmQyFQUN5zxMjVKDastoj8)_2a#%7G&T8xd}7IXNAY{9&J4<2HS A=l}o! literal 0 HcmV?d00001 diff --git a/__pycache__/test_functions.cpython-314-pytest-9.1.1.pyc b/__pycache__/test_functions.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22351b7a26347b0b967534d207ad039a4f19fbb4 GIT binary patch literal 3307 zcmeHJ%}*Og6rb5$f7>{1(j>GXu%fiMi4DeX3ZX=;l1S!IN;j!BBUNGR=dCXy*F>(%sh|Zyc>O~ zID+RV`IoPL#Ryfo5ImAk4j%$}isq4uXOM&4Rw~OKX$X}SCp5%+q?vFz;zY_(Ct8j< zF;^#pF76~;j%SiiQdO=XC#8k}`&4`lWy1%2irK8pWTRGNQQBE>h*5P|wArzohHZ7T zmHu2{0syli6)cIG{gaLM15 zEzO6P$1Czg8KLES@A>^p{~$Dgv|#6G4*Z;aGDuBTlprRiFJU=}M&7GefI9R8io*3k}^a0N#Ot!mYBw*uQEOEHS zVe(blpcK;E@bwY9TPS2HQ+PYeLew^@CR1p=VY8SkaJq?KNz>Dt_?t;S;8vE#zxB!R zwCiImOGmh7JWFr7ic*$lD#k|$TKeoG$NgdrF>OOICZqu=JMEG+9ii#-hnRu)a^+JvG{``-HR! zyQnX=Nz-t2^NDR4EyIDH%?L~I8NBTmdWB-I@IkLI(JOrDEzxsb7&|77(+Grq*n8NQ zcW-N7K$NLQtMz8X&>plqq-tuaX}761Gxym8t=f2;Yk-uaCZ(`Es;!vj*AtrI6tubS zLkLr&wRHc9(X=g7bECG{X;t|~Xx{F!s29jujl2u<@^nRSK+1lKUZyW>DgEmifVJZ4 z^0P@G8`y;(@9Zo6-n*mpuTBa{khP+q+kCty?Sb*KM|ZhvK?4_{-N0gGFM**i)0elD z{6-i67PPXH7y|Zu%7qt+{J!G9J4${lF(gDm_$qvpZSKO8_LThUibr?3cR_^@P(Pm% zLr)Nx{SabyyZ{l``91jaKmj7dbuPUwAGDHSA3+BNJ#bj?=q~pyXy5|08@_=UF9^&{c)^)XvuJP;xEp8vx_5Qtz3dHHFi*@C z(s1A!5Goe&b%ckF#YDn%uOBan2e*KAXs0ffv8%N6mJvW0`kI q5k~Nem<|K{DPxTPK