TST: Skip db tests unless explicitly specified in -m pattern
- [x] closes #24485

Since #24450 we don't skip the db tests if the connection fails. That's useful, because the CI won't fail silently if there is any problem with the databases. But as reported in #24485, it's common to have `pymysql` or `psycopg2` installed locally, but no database connection. This is making the tests fail locally, and the agreed solution is to skip the db tests unless they are explicitly requested. 

But pytest doesn't make it easy to skip tests by default when using `-m`, but this solution should work. Another option would be an `--include-db` option, but I think it makes reading the expressions in the build very difficult (like, what `--only-slow --include-db` runs?). With `-m` the expressions are much clearer (e.g. `slow and db`), so I think this option is better.

The `eval` is how `pytest` itself evaluates the value of the `-m` parameter.
