-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip SQL tests if tarantool version < 2.0.0
Problem: all SQL-related tests fail with the following error if tarantool < 2.0.0 is used: tarantool.error.DatabaseError: (48, 'Unknown request type 11') Tarantool supports SQL-related stuff only since the 2.0.0 version. So this patch adds a special decorator that will skip the test if tarantool version < 2.0.0 is used.
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import functools | ||
import pkg_resources | ||
|
||
SQL_SUPPORT_TNT_VERSION = '2.0.0' | ||
|
||
|
||
def skip_or_run_sql_test(func): | ||
@functools.wraps(func) | ||
def wrapper(self, *args, **kwargs): | ||
tnt_version = pkg_resources.parse_version(self.tnt_version) | ||
sql_support_tnt_version = pkg_resources.parse_version( | ||
SQL_SUPPORT_TNT_VERSION | ||
) | ||
|
||
if tnt_version < sql_support_tnt_version: | ||
self.skipTest( | ||
'Tarantool %s does not support SQL' % self.tnt_version | ||
) | ||
else: | ||
func(self, *args, **kwargs) | ||
|
||
return wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters