alan-turing-institute / p2lab-pokemon

A Python library for running genetic algorithms to optimize Pokemon teams!
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Adds tests for battles #50

Closed AoifeHughes closed 1 year ago

AoifeHughes commented 1 year ago

This builds on #44 and should not be merged yet

AoifeHughes commented 1 year ago

This fails because asyncio testing is annoying - fix inc

phinate commented 1 year ago

just coming to this now, thank you for the tests!!

i'm gonna make some changes now before getting this in:

phinate commented 1 year ago

oh, and i saw you moved stuff to a new battling folder -- what was the reason for that? I was trying to keep all showdown/poke-env-related utils in the pokemon sub-module, if that helps explain the way it was

codecov-commenter commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@fd87a31). Click here to learn what that means. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #50   +/-   ##
=======================================
  Coverage        ?   43.98%           
=======================================
  Files           ?       15           
  Lines           ?      407           
  Branches        ?        0           
=======================================
  Hits            ?      179           
  Misses          ?      228           
  Partials        ?        0           
AoifeHughes commented 1 year ago

Still very confused how these tests are running on CI, for me:

(playground) ➜  P2-Lab git:(main) pytest
=========================================================== test session starts ============================================================
platform darwin -- Python 3.10.11, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/ahughes/git/P2-Lab
configfile: pyproject.toml
testpaths: tests
plugins: asyncio-0.21.0, cov-4.1.0, asyncio-cooperative-0.30.0, anyio-3.7.0
asyncio: mode=strict
collected 21 items

tests/test_battles.py ^[[A^C

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/Users/ahughes/miniconda3/envs/playground/lib/python3.10/selectors.py:562: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --full-trace)
==================================================== no tests ran in 379.78s (0:06:19) =====================================================
^C

I have to cancel out of them because they do not run without async tags on functions, awaits etc.