FuelRats / FCMS

Fleet Carrier Management System
BSD 3-Clause "New" or "Revised" License
26 stars 7 forks source link

cant run website #174

Closed elgarty closed 10 months ago

elgarty commented 10 months ago

on pytest and when going on the website i get errors saying Type error options is an invalid keyword argument for this function

Errors:

Pytest: `===================================================================================== test session starts ====================================================================================== platform linux -- Python 3.9.2, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/mmuchi030674/FCMS/FCMS configfile: pytest.ini testpaths: FCMS plugins: cov-4.1.0 collected 2 items

FCMS/tests.py FFE [100%]

============================================================================================ ERRORS ============================================================================================ __ ERROR at teardown of TestMyViewFailureCondition.test_failing_view ___

self =

def tearDown(self):
    from .models.meta import Base

    testing.tearDown()
    transaction.abort()
  Base.metadata.drop_all(self.engine)

FCMS/tests.py:40:


env/lib/python3.9/site-packages/sqlalchemy/sql/schema.py:5856: in drop_all bind._run_ddl_visitor( env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3242: in _run_ddl_visitor with self.begin() as conn: /usr/lib/python3.9/contextlib.py:117: in enter return next(self.gen) env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3232: in begin with self.connect() as conn: env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3268: in connect return self._connection_cls(self) env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:145: in init self._dbapi_connection = engine.raw_connection() env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3292: in raw_connection return self.pool.connect() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:421: in connect return _ConnectionFairy._checkout(self, self._fairy) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:1269: in _checkout fairy = _ConnectionRecord.checkout(pool) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:716: in checkout rec = pool._do_get() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:403: in _do_get c = self._create_connection() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:393: in _create_connection return _ConnectionRecord(self) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:678: in init self.connect() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:903: in connect pool.logger.debug("Error on connect(): %s", e) env/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py:146: in exit raise exc_value.with_traceback(exc_tb) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:898: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) env/lib/python3.9/site-packages/sqlalchemy/engine/create.py:637: in connect return dialect.connect(*cargs, **cparams)


self = <sqlalchemy.dialects.sqlite.pysqlite.SQLiteDialect_pysqlite object at 0x7b8b14b227c0>, cargs = (':memory:',), cparams = {'check_same_thread': True, 'options': '-c timezone=utc'}

def connect(self, *cargs, **cparams):
    # inherits the docstring from interfaces.Dialect.connect
  return self.loaded_dbapi.connect(*cargs, **cparams)

E TypeError: 'options' is an invalid keyword argument for this function

env/lib/python3.9/site-packages/sqlalchemy/engine/default.py:616: TypeError =========================================================================================== FAILURES =========================================================================================== _ TestMyViewSuccessCondition.test_passingview

self =

def setUp(self):
    super(TestMyViewSuccessCondition, self).setUp()
  self.init_database()

FCMS/tests.py:47:


FCMS/tests.py:33: in init_database Base.metadata.create_all(self.engine) env/lib/python3.9/site-packages/sqlalchemy/sql/schema.py:5828: in create_all bind._run_ddl_visitor( env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3242: in _run_ddl_visitor with self.begin() as conn: /usr/lib/python3.9/contextlib.py:117: in enter return next(self.gen) env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3232: in begin with self.connect() as conn: env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3268: in connect return self._connection_cls(self) env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:145: in init self._dbapi_connection = engine.raw_connection() env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3292: in raw_connection return self.pool.connect() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:421: in connect return _ConnectionFairy._checkout(self, self._fairy) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:1269: in _checkout fairy = _ConnectionRecord.checkout(pool) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:716: in checkout rec = pool._do_get() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:403: in _do_get c = self._create_connection() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:393: in _create_connection return _ConnectionRecord(self) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:678: in init self.connect() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:903: in connect pool.logger.debug("Error on connect(): %s", e) env/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py:146: in exit raise exc_value.with_traceback(exc_tb) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:898: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) env/lib/python3.9/site-packages/sqlalchemy/engine/create.py:637: in connect return dialect.connect(*cargs, **cparams)


self = <sqlalchemy.dialects.sqlite.pysqlite.SQLiteDialect_pysqlite object at 0x7b8b14f75370>, cargs = (':memory:',), cparams = {'check_same_thread': True, 'options': '-c timezone=utc'}

def connect(self, *cargs, **cparams):
    # inherits the docstring from interfaces.Dialect.connect
  return self.loaded_dbapi.connect(*cargs, **cparams)

E TypeError: 'options' is an invalid keyword argument for this function

env/lib/python3.9/site-packages/sqlalchemy/engine/default.py:616: TypeError _ TestMyViewFailureCondition.test_failingview

self =

def test_failing_view(self):
    from .views.default import my_view
  info = my_view(dummy_request(self.session))

FCMS/tests.py:65:


FCMS/views/default.py:13: in my_view one = query.filter(models.MyModel.name == 'one').first() env/lib/python3.9/site-packages/sqlalchemy/orm/query.py:2748: in first return self.limit(1)._iter().first() # type: ignore env/lib/python3.9/site-packages/sqlalchemy/orm/query.py:2847: in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( env/lib/python3.9/site-packages/sqlalchemy/orm/session.py:2308: in execute return self._execute_internal( env/lib/python3.9/site-packages/sqlalchemy/orm/session.py:2180: in _execute_internal conn = self._connection_for_bind(bind) env/lib/python3.9/site-packages/sqlalchemy/orm/session.py:2047: in _connection_for_bind return trans._connection_for_bind(engine, execution_options)

:2: in _connection_for_bind ??? env/lib/python3.9/site-packages/sqlalchemy/orm/state_changes.py:139: in _go ret_value = fn(self, *arg, **kw) env/lib/python3.9/site-packages/sqlalchemy/orm/session.py:1143: in _connection_for_bind conn = bind.connect() env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3268: in connect return self._connection_cls(self) env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:145: in __init__ self._dbapi_connection = engine.raw_connection() env/lib/python3.9/site-packages/sqlalchemy/engine/base.py:3292: in raw_connection return self.pool.connect() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:421: in connect return _ConnectionFairy._checkout(self, self._fairy) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:1269: in _checkout fairy = _ConnectionRecord.checkout(pool) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:716: in checkout rec = pool._do_get() env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py:403: in _do_get c = self._create_connection() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:393: in _create_connection return _ConnectionRecord(self) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:678: in __init__ self.__connect() env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:903: in __connect pool.logger.debug("Error on connect(): %s", e) env/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py:146: in __exit__ raise exc_value.with_traceback(exc_tb) env/lib/python3.9/site-packages/sqlalchemy/pool/base.py:898: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) env/lib/python3.9/site-packages/sqlalchemy/engine/create.py:637: in connect return dialect.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , cargs = (':memory:',), cparams = {'check_same_thread': True, 'options': '-c timezone=utc'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.loaded_dbapi.connect(*cargs, **cparams) E TypeError: 'options' is an invalid keyword argument for this function env/lib/python3.9/site-packages/sqlalchemy/engine/default.py:616: TypeError ======================================================================================= warnings summary ======================================================================================= env/lib/python3.9/site-packages/pyramid/asset.py:2 /home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/asset.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868 /home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('paste')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868 env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868 env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868 /home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) FCMS/tests.py::TestMyViewSuccessCondition::test_passing_view /home/mmuchi030674/FCMS/FCMS/FCMS/models/meta.py:17: MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) Base = declarative_base(cls=DictableModel, metadata=metadata) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =================================================================================== short test summary info ==================================================================================== FAILED FCMS/tests.py::TestMyViewSuccessCondition::test_passing_view - TypeError: 'options' is an invalid keyword argument for this function FAILED FCMS/tests.py::TestMyViewFailureCondition::test_failing_view - TypeError: 'options' is an invalid keyword argument for this function ERROR FCMS/tests.py::TestMyViewFailureCondition::test_failing_view - TypeError: 'options' is an invalid keyword argument for this function ============================================================================ 2 failed, 6 warnings, 1 error in 6.31s ============================================================================` Website: `Traceback (most recent call last): File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid_debugtoolbar/panels/performance.py", line 61, in resource_timer_handler result = handler(request) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid_tm/__init__.py", line 178, in tm_tween raise exc from None File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid_tm/__init__.py", line 145, in tm_tween response = handler(request) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/tweens.py", line 43, in excview_tween response = _error_handler(request, exc) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/tweens.py", line 17, in _error_handler reraise(*exc_info) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/util.py", line 733, in reraise raise value File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/tweens.py", line 41, in excview_tween response = handler(request) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/router.py", line 143, in handle_request response = _call_view( File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/view.py", line 674, in _call_view response = view_callable(context, request) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/viewderivers.py", line 427, in rendered_view result = view(context, request) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/pyramid/viewderivers.py", line 141, in _requestonly_view response = view(request) File "/home/mmuchi030674/FCMS/FCMS/FCMS/views/landing.py", line 30, in my_view return {'searchform': rendered_form, 'deform': True, 'tracked_carriers': ct.count(), File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3132, in count self._legacy_from_self(col).enable_eagerloads(False).scalar() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2825, in scalar ret = self.one() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2798, in one return self._iter().one() # type: ignore File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2847, in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2308, in execute return self._execute_internal( File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2180, in _execute_internal conn = self._connection_for_bind(bind) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2047, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) File "", line 2, in _connection_for_bind # Copyright (C) 2005-2023 the SQLAlchemy authors and contributors File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1143, in _connection_for_bind conn = bind.connect() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3268, in connect return self._connection_cls(self) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 145, in __init__ self._dbapi_connection = engine.raw_connection() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3292, in raw_connection return self.pool.connect() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 452, in connect return _ConnectionFairy._checkout(self) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 1269, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 716, in checkout rec = pool._do_get() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 170, in _do_get self._dec_overflow() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__ raise exc_value.with_traceback(exc_tb) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 167, in _do_get return self._create_connection() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 393, in _create_connection return _ConnectionRecord(self) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 678, in __init__ self.__connect() File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 903, in __connect pool.logger.debug("Error on connect(): %s", e) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__ raise exc_value.with_traceback(exc_tb) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 898, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/engine/create.py", line 637, in connect return dialect.connect(*cargs, **cparams) File "/home/mmuchi030674/FCMS/FCMS/env/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 616, in connect return self.loaded_dbapi.connect(*cargs, **cparams) TypeError: 'options' is an invalid keyword argument for this function` How to fix?
elgarty commented 10 months ago

How to do you get a Frontier API secret i can only get the id

kenneaal commented 10 months ago

FCMS does not implement tests. These are again Pyramid boiler code that isn't applicable to FCMS. Frontier API secrets are requested through Frontier's developer program.