Commit Graph

15 Commits

Author SHA1 Message Date
Takashi Kajinami
07fd2f2c47 Replace deprecated inspect.getargspec
inspect.getargspec was deprecated since Python 3.0 and
inspect.getfullargspec is its replacement with correct handling of
function annotations and keyword-only parameters[1].

[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec

Change-Id: I29478df88665ee5311e3ba308ab645c47e5b0fc8
2021-07-19 09:58:51 +09:00
Andreas Jaeger
d459c3fe4b Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.1.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: I810e4c30513746bc46a3e65b398539929a7ac6b0
2020-05-16 19:29:41 +02:00
Sean McGinnis
4d2310b2a9
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I26f2df6d4657133a5c7e6ed85298aa843c1bdd73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 15:56:19 -05:00
Stephen Finucane
298c5107eb Bump to hacking 2.x
This allows us to use a new version of flake8 that supports Python
3-only syntax. Existing issues are resolved.

Change-Id: I5de7e5cde6a5260f4e7e57586952256b59d3756d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-02-07 10:35:08 -08:00
Stephen Finucane
da7cd17a2b Drop use of six
We no longer need much of the functionality this was providing.

Change-Id: I0f625b714950a712249757906974715358f9e6c6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-02-07 10:35:08 -08:00
ZhijunWei
e2f25b563e Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: Ie245c376f126b885dcf8e9bb250355f98613a6a4
2019-02-17 11:24:12 +08:00
Charles Short
eca8c7c039 Remove moxstubout usage
In newer versions of oslotest, moxstubout will be deprecated.
So we can get out in front of the curve now and remove it.

Change-Id: I7b39aa52d3051e81a908277a6fc956d680d653e7
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-05-17 22:12:53 -04:00
Davanum Srinivas
97aa084409 Remove ununsed class in test.py
There's a TimeFixture in oslo.utils if we really need it,
but we don't use this class anywhere

Change-Id: I37d7024550a33d14dff567f1f597b3870d2f2b5a
2015-07-13 22:30:12 -04:00
Grzegorz Grasza
c5a73c44b4 Remove already commented out and unused fixtures
Remove Service, Database and RPC fixtures, since we don't have services and
DB/RPC APIs to mock in this library. Remove unused configuration fixtures.

Change-Id: I3be004fa873baa06dae9e0fb55740b035581a85d
2015-02-19 16:31:02 +01:00
Grzegorz Grasza
0d4bd24ed3 Rename utils -> _utils
Hide the utils module, which should not be part of the public API.
utils.py contains functions required internally (moved from Nova).

Change-Id: I3666d35d28592bd49768424049142e5d353a916d
Closes-Bug: 1417284
2015-02-16 11:19:31 +01:00
Grzegorz Grasza
c330f938c8 Remove references to Nova
Remove remaining references to "Nova" where possible, code cleanup.
Also removed IP fields

Co-Authored-By: Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com>
Change-Id: Ibad8f9fc6453321055029ad69b0374261509b9d5
Closes-Bug: 1417287
2015-02-12 08:30:06 -08:00
Dan Smith
4b76fbde46 Replace metaclass-based registry with a decorator-based one
In nova, we used a metaclass to ensure that merely defining an object as
inheriting from the base would register it for use. I don't feel that is
a responsible way for the library to behave, since just importing a module
full of objects would allow things to be registered which might enable
RPC methods that are undesired.

Further, it complicated our ability to register alternate implementations
of certain objects, and provided no end of complication to our tests.

This patch adds a decorator-based object registry that looks much the same,
but requires explicit opt-in registration to objects before they can be
deserialized over RPC and instantiated by name.

Change-Id: Ic50ea4d59df7981eb8a413b5c80ca47155864166
2015-02-11 09:42:19 -08:00
Dan Smith
ed7c5377d4 Rename tests/fixtures to test/obj_fixtures to avoid import collisions
Change-Id: I0e64acb7efc9c5b9f65f4771886335309d4df36a
2015-02-11 09:36:46 -08:00
Doug Hellmann
1e146a916e clean up and get most test running
Remove extraneous utility code and tests.

Skip tests related to remote object verification until we can rewrite
them (see the adopt-oslo-versionedobjects spec for details).

Fix pep8 errors.

Update requirements.

Set python's hash seed in tox.ini for tests that compare things that
might come out in a different order.
2015-02-02 16:24:14 -05:00
Doug Hellmann
591c480caf rename files 2015-02-02 15:07:55 -05:00