Skip to content

bug(tests,constraints): pytest failures on clean run, constructor arg collision, rcParams leak, scalar Quantity indexing #141

@pankaj-bind

Description

@pankaj-bind

Running pytest tests/ fails due to three independent bugs:

1. tests/test_route_postprocessing.py:132
boat_speed passed as a positional arg to RoutePostprocessing, but the
constructor is (min_fuel_route, boat, db_engine=None) - causes TypeError: multiple values for argument 'db_engine' on all tests in that class.

2. tests/test_direct_power_method.py:186
test_wind_coeff sets plt.rcParams['text.usetex'] = True and never restores
it, breaking downstream tests with a LaTeX-not-found RuntimeError.

3. WeatherRoutingTool/constraints/route_postprocessing.py:508
calculate_timsestamp() indexes speed[idx] unconditionally - crashes when
speed is a scalar astropy.units.Quantity.

I have a fix ready and will open a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions