Comments (22)
Tests require pytest and pytest-runner:
Line 15 in a3f6f98
Other than that, yes, you can run them this way.
from pymediainfo.
May be not close issue so fast? :)
Now tests are running but failure
running pytest
running egg_info
writing pymediainfo.egg-info/PKG-INFO
writing namespace_packages to pymediainfo.egg-info/namespace_packages.txt
writing top-level names to pymediainfo.egg-info/top_level.txt
writing dependency_links to pymediainfo.egg-info/dependency_links.txt
reading manifest file 'pymediainfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '.*'
'tests/data/accentué.txt' not ANSI_X3.4-1968 encodable -- skipping
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
writing manifest file 'pymediainfo.egg-info/SOURCES.txt'
running build_ext
============================================================= test session starts ==============================================================
platform linux2 -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/vascom/rpmbuild/BUILD/python-pymediainfo-2.2.0/python2, inifile:
collected 15 items
tests/test_pymediainfo.py ............F.s
=================================================================== FAILURES ===================================================================
_____________________________________________ MediaInfoUnicodeFileNameTest.test_parse_unicode_file _____________________________________________
self = <test_pymediainfo.MediaInfoUnicodeFileNameTest testMethod=test_parse_unicode_file>
def test_parse_unicode_file(self):
> self.assertEqual(len(self.mi.tracks), 1)
E AssertionError: 0 != 1
tests/test_pymediainfo.py:83: AssertionError
================================================ 1 failed, 13 passed, 1 skipped in 3.15 seconds ================================================
from pymediainfo.
Hehe yeah, my bad :) Can you check that you're using an UTF-8 locale?
from pymediainfo.
$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
With LANG=C I have the same error.
from pymediainfo.
Does the test system use the same locales? Can you try running python2 demo.py tests/data/accentué.txt
manually and see if it works?
It should yield:
+---------+
| General |
+---------+
{'complete_name': u'tests/data/accentu\xe9.txt',
'count': '328',
'count_of_stream_of_this_kind': '1',
'file_extension': 'txt',
'file_last_modification_date': 'UTC 2016-04-30 21:05:40',
'file_last_modification_date__local': '2016-04-30 23:05:40',
'file_name': u'accentu\xe9',
'file_size': 20,
'folder_name': 'tests/data',
'kind_of_stream': 'General',
'other_file_size': ['20.0 Bytes',
'20 Bytes',
'20 Bytes',
'20.0 Bytes',
'20.00 Bytes'],
'other_kind_of_stream': ['General'],
'other_stream_size': ['20.0 Bytes (100%)',
'20 Bytes',
'20 Bytes',
'20.0 Bytes',
'20.00 Bytes',
'20.0 Bytes (100%)'],
'proportion_of_this_stream': '1.00000',
'stream_identifier': '0',
'stream_size': 20,
'track_type': 'General'}
from pymediainfo.
Locale the same. I am built and run it on my local computer.
Yes, it work
+---------+
| General |
+---------+
{'complete_name': u'tests/data/accentu\xe9.txt',
'count': '328',
'count_of_stream_of_this_kind': '1',
'file_extension': 'txt',
'file_last_modification_date': 'UTC 2017-11-07 23:04:01',
'file_last_modification_date__local': '2017-11-08 02:04:01',
'file_name': u'accentu\xe9',
'file_size': 20,
'folder_name': 'tests/data',
'kind_of_stream': 'General',
'other_file_size': ['20.0 Bytes',
'20 Bytes',
'20 Bytes',
'20.0 Bytes',
'20.00 Bytes'],
'other_kind_of_stream': ['General'],
'other_stream_size': ['20.0 Bytes (100%)',
'20 Bytes',
'20 Bytes',
'20.0 Bytes',
'20.00 Bytes',
'20.0 Bytes (100%)'],
'proportion_of_this_stream': '1.00000',
'stream_identifier': '0',
'stream_size': 20,
'track_type': 'General'}
from pymediainfo.
May be it is because
'tests/data/accentué.txt' not ANSI_X3.4-1968 encodable -- skipping
from pymediainfo.
And if you run the tests manually, I assume it works too? This must be a problem with the RPM build system changing locales.
from pymediainfo.
The RPM system re-creates the source tarball?
from pymediainfo.
Hm, if I run tests manually, not from rpmbuild - all passed. And there is no skipping warning.
from pymediainfo.
No, source tarball not reacreated.
from pymediainfo.
Do you know what command produces the ANSI_X3.4-1968 error? Is it a setup.py command?
from pymediainfo.
From what I understand, it could be due to an old setuptools version.
from pymediainfo.
In rpmbuild this locale:
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
And with LANG=C test failed manually.
from pymediainfo.
OK so I guess you just have to change the rpmbuild locale, if possible. Or skip this particular test.
from pymediainfo.
Are you sure that this is not problem in test? Because LANG=C is most default problemless variant of locale.
from pymediainfo.
I never was able to parse an accentuated file without an UTF-8 locale: MediaArea/MediaInfoLib#144
if this is a bug, it's a MediaInfo bug: try running mediainfo tests/data/accentué.txt
with LANG=C and it will fail too.
from pymediainfo.
OK. How to skip this particular test?
from pymediainfo.
Instead of running setup.py test
, you can run pytest -k "not test_parse_unicode_file"
.
from pymediainfo.
And if you run pytest directly, you do not need pytest-runner, this one is only for setup.py support.
from pymediainfo.
Thanks. I will use
PYTEST_ADDOPTS='-k "not test_parse_unicode_file"' %{__python2} setup.py test
from pymediainfo.
Cool! Thanks for adding this to Fedora!
from pymediainfo.
Related Issues (20)
- Failing test_thread_safety HOT 10
- OSError: Failed to load library; Error occurred in macOS version 11.0.1 HOT 4
- build failure with setuptools_scm 6.0.1 on Python 2.7 HOT 7
- How to fetch `Format settings, GOP` info? HOT 6
- OSError: Failed to load library HOT 5
- Replace pkg_resources with importlib.metadata HOT 3
- How to use template, or specify --outputfile. HOT 1
- Deployment process in Aws lambda function[Not as a lambda layer] HOT 7
- when i use this pymediainfo, i meet some problem like that , see the picture below. it can't loading dylib. (python3.8 macOS 11.3) HOT 2
- Cannot load MediaInfo.dll (windows) from Python 3.8 HOT 10
- Duration for .webm videos returns as string HOT 1
- Mac Install issue: ModuleNotFoundError: No module named 'pymediainfo' HOT 4
- PyInstaller + macOS: "An error occured while opening" files with special characters HOT 5
- Error HOT 7
- output="" for MediaInfo.parse is equivalent to -f HOT 4
- Segmentation Fault HOT 8
- On Mac Os X HOT 3
- AttributeError: Undefined symbol "MediaInfo_Inform" since libmediainfo-update HOT 6
- Add support for macOS ARM HOT 12
- Wheels for Linux HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymediainfo.