bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.33k stars 1.46k forks source link

fix tests RuntimeWarning #1398

Open clavedeluna opened 1 year ago

clavedeluna commented 1 year ago

When running tests, the following warnings appeared

test/test_router.py::TestRouter::testFloatFilter
test/test_router.py::TestRouterInCGIMode::testFloatFilter
  /Users/dani/bottle/bottle.py:419: RuntimeWarning: Route <GET /object/<id:float>> overwrites a previously defined route
    warnings.warn(msg % (method, rule), RuntimeWarning)

test/test_router.py::TestRouter::testParentheses
test/test_router.py::TestRouterInCGIMode::testParentheses
  /Users/dani/bottle/bottle.py:419: RuntimeWarning: Route <GET /func2(:param#(foo|bar)#)> overwrites a previously defined route
    warnings.warn(msg % (method, rule), RuntimeWarning)

These seem to me to be purely an artifact of the way the tests were written, so I updated the route name for the tests. This removes the warning and (I believe) keep the test integrity.